{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/coupon/index')}">优惠券管理</a></li>
            <li class=""><a href="{:url('admin/coupon/add')}">添加优惠券</a></li>
            <li class="layui-this">编辑优惠券</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/coupon/update')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">优惠券名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="{$coupon.name}" required lay-verify="required" placeholder="请输入优惠券名称" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">支付金额</label>
                        <div class="layui-input-block">
                            <input type="text" name="payMoney" value="{$coupon.payMoney}" required lay-verify="required" placeholder="请输入支付金额" class="layui-input" onkeydown="return event.keyCode>=48&&event.keyCode<=57 || event.keyCode>=96&&event.keyCode<=105 || event.keyCode==8" ng-pattern="/[^a-zA-Z]/" >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">抵消金额</label>
                        <div class="layui-input-block">
                            <input type="text" name="offsetMoney" value="{$coupon.offsetMoney}" required lay-verify="required" placeholder="请再次抵消金额" class="layui-input" onkeydown="return event.keyCode>=48&&event.keyCode<=57 || event.keyCode>=96&&event.keyCode<=105 || event.keyCode==8" ng-pattern="/[^a-zA-Z]/" >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">有效期(天)</label>
                        <div class="layui-input-block">
                            <input type="text" name="period" value="{$coupon.period}" placeholder="选填:请输入有效期(默认1)" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">优惠券样图</label>
                        <div class="layui-input-block">
                            <input type="text" name="photo" value="{$coupon.photo}" class="layui-input layui-input-inline" id="photo">
                            <input type="file" name="file" class="layui-upload-file" id='photo1'>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排序</label>
                        <div class="layui-input-block">
                            <input type="text" name="sort" value="{$coupon.sort}" required  lay-verify="required" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="1" title="启用" {if condition="$coupon.status==1"} checked="checked"{/if}>
                            <input type="radio" name="status" value="0" title="禁用" {if condition="$coupon.status==0"} checked="checked"{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id" value="{$coupon.id}">
                            <button class="layui-btn" lay-submit lay-filter="*">更新</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
                <div class="smallImg {notempty name='$coupon.photo'}smallImgCss{/notempty}" style="background-image:url('{notempty name='$coupon.photo'}{$coupon.photo}{/notempty}');" id="phot"></div>
            </div>
        </div>
    </div>
</div>
{/block}